import { IMessageBase } from "../../Framework/MQ/IMessageBase";
import { MessageManager } from "../../Framework/MQ/MessageManager";
import { SerializeStream } from "../../Framework/Serialize/SerializeStream";
import { SeqPlayerItemHelper } from "./SeqPlayerItemHelper";
import { SEntityId } from "./SEntityId";
type int = number;
//class SStallBuy
    
    export  class SStallBuy extends IMessageBase
    {
        constructor(arg1: Boolean=false)
        {
            
            super();if (arg1) 
            {
                MessageManager.instance().regist(this);
            }
            return;
        }

        public /* override */ getType(): int
        {
            return this._type;
        }

        public /* override */ clone(): IMessageBase
        {
            return new SStallBuy();
        }

        public /* override */ __write(arg1: SerializeStream): void
        {
            this.buyEntityId.__write(arg1);
            arg1.writeString(this.buyPlayerName);
            this.stallEntityId.__write(arg1);
            arg1.writeString(this.stallPlayerName);
            arg1.writeString(this.uid);
            arg1.writeInt(this.itemCode);
            arg1.writeString(this.itemName);
            arg1.writeInt(this.amount);
            arg1.writeInt(this.coin);
            arg1.writeInt(this.gold);
            arg1.writeBool(this.result);
            SeqPlayerItemHelper.write(arg1, this.playerItems);
            return;
        }

        public /* override */ __read(arg1: SerializeStream): void
        {
            this.buyEntityId = new SEntityId();
            this.buyEntityId.__read(arg1);
            this.buyPlayerName = arg1.readString();
            this.stallEntityId = new SEntityId();
            this.stallEntityId.__read(arg1);
            this.stallPlayerName = arg1.readString();
            this.uid = arg1.readString();
            this.itemCode = arg1.readInt();
            this.itemName = arg1.readString();
            this.amount = arg1.readInt();
            this.coin = arg1.readInt();
            this.gold = arg1.readInt();
            this.result = arg1.readBool();
            this.playerItems = SeqPlayerItemHelper.read(arg1);
            return;
        }

        public /* const */_type: int=20303;

        public /* var */buyEntityId: SEntityId;

        public /* var */buyPlayerName: string;

        public /* var */stallEntityId: SEntityId;

        public /* var */stallPlayerName: string;

        public /* var */uid: string;

        public /* var */itemCode: int;

        public /* var */itemName: string;

        public /* var */amount: int;

        public /* var */coin: int;

        public /* var */gold: int;

        public /* var */result: Boolean;

        public /* var */playerItems: Array<any>;

        public static /* var */_regist: SStallBuy;
    }

            SStallBuy._regist = new SStallBuy(true);
        